//  测试动画
var interval = {};
$(".move-ele").each(function () {
  var $this = $(this);
  addInterval($this);
});
// 添加定时器
function addInterval($this) {
  var unit = parseInt($this.attr("data-num"));
  var id = $this.attr("id");
  interval[id] = setInterval(function () {
    $this.append(
      "<span class='money m1 fadeOutUp animated infinite'>+" + unit * 100 + "</span>"
    );

    // 添加金币
    $this.find(".animal").addClass("pulse animated infinite");

    // 金币动效
    var $sum = $(".jin-award .sum");
    var num = $sum.text().split("k")[0] * 1000;
    $sum.addClass("bigPulse animated infinite").text((num + unit) / 1000 + "k");
    var audio = $("#up_" + id + ':not(.pause)');
    if (audio.length) {
      audio[0].play();
    }

    // 删除元素  和动效
    setTimeout(function () {
      // 删除动效动效
      $sum.removeClass("bigPulse animated fast infinite");
      $this.find(".animal").removeClass("pulse animated fast infinite");

      // 删除元素
      $this.find(".m1").remove();
    }, 1000);
  }, 4000);
}

//  收益动效
setInterval(function () {
  $(".buy").addClass("tada animated infinite");

  // 删除动效
  setTimeout(function () {
    $(".buy").removeClass("tada animated infinite");
  }, 1000);
}, 5000);